Source File
xmlnode.go
Belonging Package
github.com/ChrisTrenkamp/goxpath/tree/xmltree/xmlnode
package xmlnodeimport ()//XMLNode will represent an attribute, character data, comment, or processing instruction nodetype XMLNode struct {xml.Tokentree.NodePostree.NodeTypeParent tree.Elem}//GetToken returns the xml.Token representation of the nodefunc ( XMLNode) () xml.Token {if .NodeType == tree.NtAttr {:= .Token.(*xml.Attr)return *}return .Token}//GetParent returns the parent nodefunc ( XMLNode) () tree.Elem {return .Parent}//ResValue returns the string value of the attributefunc ( XMLNode) () string {switch .NodeType {case tree.NtAttr:return .Token.(*xml.Attr).Valuecase tree.NtChd:return string(.Token.(xml.CharData))case tree.NtComm:return string(.Token.(xml.Comment))}//case tree.NtPi:return string(.Token.(xml.ProcInst).Inst)}
![]() |
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |